-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: update nix dependency to 0.28 #6474
Conversation
`nix::unistd::write` now requies an `trait AsFd`, which `RawFd` does not implement, so, the `struct FileDescriptor` field has been switched to `OwnedFd`. An alternative solution is to use `BorrowedFd::borrow_raw`, but that requires unsafe code.
Not sure how these changes could cause that FreeBSD build failure |
This comment was marked as outdated.
This comment was marked as outdated.
Perhaps we just need to enable the |
After adding the feature, there are some new compilation failures:
|
We need to update nix used in mio-aio first. (it also enables aio feature of nix) |
What's the motivation to update nix? |
I want to update the version of |
The major difference between nix 0.27 and 0.28 is I/O safety. I've previously broached that topic with Tokio maintainers and they weren't interested, for good reason. So I think Tokio is best sticking with nix 0.27. |
Our MSRV is now 1.63, so I don't think I/O safety traits are an issue anymore. But I'm not sure it matters so much for nix, since we only use it in tests. |
I wonder if it would make sense for the tokio tests to use the |
The big problem with I/O safety is lifetimes. Tokio programs need to create lots of futures with the lifetime of a file. And nontrivial Tokio programs usually need those lifetimes to be |
You can always just convert the |
Yeah, but if you're going to do that, then what's the point of using I/O safety at all? |
I would generally prefer to not be stuck on an old version of a dependency forever, even if it's test-only. If avoiding that requires |
In that case we can do it. But as @taiki-e said, we'll have to update mio-aio first. I'm probably the only one who can do that, and i'll need to ensure that it can still work with all downstream dependencies. BUT ATM I'm hobbled up with a broken arm so it might take me a few weeks. |
If you're willing to do the mio-aio upgrade, then I would definitely appreciate it! There's no rush from my side, and a few weeks is not a problem at all. @fkm3 We can carry a patch in Android's vendored version of Tokio for now. |
It is the same argument for most other unsafe APIs: we want people to prefer the safe technique and make it obvious they are doing something "unsafe" that can result in bugs and security vulnerabilities. Making syscalls on a closed FD can be just as bad as a use-after-free bug, the FD number might have been reused already. I don't know how relevant that is to
Sounds good. Thanks both of you |
Marking this PR as blocked until mio-aio is upgraded. |
Not possible to make this change upstream yet, see tokio-rs/tokio#6474. Bug: 333427576 Test: TreeHugger Change-Id: I950e3e7efc41e0e8e23db373ff918d11a4362359
I looked over your PR, and it looks good to me. Thanks! |
nix::unistd::write
now requies antrait AsFd
, whichRawFd
does not implement, so, thestruct FileDescriptor
field has been switched toOwnedFd
. An alternative solution is to useBorrowedFd::borrow_raw
, but that requires unsafe code.